/********************************************************************************
 *      Copyright:  (C) 2023 Yangpeng
 *                  All rights reserved.
 *
 *       Filename:  get_temperature.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(2023年01月05日)
 *         Author:  Yangpeng <1023769078@qq.com>
 *      ChangeLog:  1, Release initial version on "2023年01月05日 17时02分31秒"
 *                 
 ********************************************************************************/
#ifndef MQTT_TXYUN_CONF_H
#define MQTT_TXIYUN_CONF_H

#define  BUF_SIZE 512

#define DEFAULT_CLIENTID    "H4C4UCNZGCds18b20"

#define DEFAULT_USERNAME    "H4C4UCNZGCds18b20;12010126;5cfa3;1683302400"
#define DEFAULT_PASSWD      "1a12038750e270d12e5b832dd7be65335ad5bb697f7227098a7253bfee6dece7;hmacsha256"

#define DEFAULT_HOSTNAME    "H4C4UCNZGC.iotcloud.tencentdevices.com"
#define DEFAULT_PORT        1883

#define DEFAULT_SUBTOPIC    "H4C4UCNZGC/ds18b20/data"
#define DEFAULT_PUBTOPIC    "H4C4UCNZGC/ds18b20/data"

#define DEFAULT_QOS         0

#define DEFAULT_METHOD      "thing.service.property.set"
#define DEFAULT_JSONID      "yangpeng"
#define DEFAULT_IDENTIFIER  "CurrentTemperature"
#define DEFAULT_VERSION     "1.0.0"

#define KEEP_ALIVE          60

enum{
    SUB,
    PUB
};

typedef struct data_mqtt
{
    char    hostname[BUF_SIZE] ;
    int     port ;
    char    username[BUF_SIZE] ;
    char    passwd[BUF_SIZE] ;
    char    clientid[BUF_SIZE] ;
    char    topic[BUF_SIZE] ;
    int     Qos;

    char    method[BUF_SIZE] ;
    char    jsonid[BUF_SIZE] ;
    char    identifier[BUF_SIZE] ;
    char    version[BUF_SIZE] ;
}data_mqtt;

int get_mqtt_conf(char *ini_path,data_mqtt *mqtt,int type);

#endif
